package org.example.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.data.annotation.Id;

import java.util.Objects;

@TableName(value = "memory")
@Data
public class Memory {
    @Id
    @TableField("id")
    int id;

    @TableField("user_id")
    String userId;

    @TableField("role_type")
    String roleType;

    @TableField("content")
    String content;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Memory memory = (Memory) o;
        return Objects.equals(id, memory.id) && Objects.equals(userId, memory.userId) && Objects.equals(roleType, memory.roleType) && Objects.equals(content, memory.content);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, roleType, content);
    }

    @Override
    public String toString() {
        return "Memory{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", roleType='" + roleType + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}


